#include "EntityManager.h"

namespace Engine
{
	EntityManager::EntityManager()
	{
	}
	Entity* EntityManager::getEntity(int id)
	{
		Entity *entity;
		std::list<Entity*>::iterator iter = EntList.begin();
		while (iter != EntList.end()) 
		{
			entity = *iter;
			if(entity->getID() == id)
				return entity;

			++iter;
		}
		return NULL;
	}
	bool EntityManager::registerEntity(Entity* ent)
	{
		if(ent == NULL)
			return false;

		EntList.push_back(ent);
		return true;
	}
}